const SAS1023 = {
  'type': 'object',
  'required': [
    'typeOfAppointment',
    'applicantInformation',
    'assignmentCommissions',
    'backgroundInformation',
    'fairCreditReporting',
    'formNumber',
    'formVersion'
  ],
  'properties': {
    'typeOfAppointment': {
      'allOf': [
        { '$ref': 'defsSchema.json#/definitions/typeOfAppointment' },
        {
          'properties': {
            'apptType': {
              'type': 'string',
              'enum': [
                'Agency Principal/Owner',
                'Producer/Writing Producer/Registered Representative'
              ]
            },
            'apptTypeRep': {
              'type': 'string',
              'enum': [
                'Platform Rep (LBE, FS)',
                'Dedicated Rep (FA)',
                'Independent Rep'
              ]
            },
            'referringAgency': {
              'type': 'string',
              'description': 'Referring Agency/Broker Dealer'
            },
            'apptTypeBankName': {
              'type': 'string',
              'description': 'Bank Name'
            }
          },
          'anyOf': [
            {
              'properties': {
                'apptType': {
                  'enum': ['Producer/Writing Producer/Registered Representative']
                }
              },
              'required': ['apptType', 'apptTypeBankName', 'apptTypeRepType']
            },
            {
              'properties': {
                'apptType': {
                  'enum': ['Agency Principal/Owner']
                }
              },
              'required': ['apptType', 'referringAgency']
            }
          ]
        }
      ]
    },
    'applicantInformation': {
      '$ref': 'defsSchema.json#/definitions/applicantInformation'
    },
    'entityLicensesRegistration': {
      'allOf': [
        {
          '$ref': 'defsSchema.json#/definitions/entityLicensesRegistration'
        },
        {
          'properties': {
            'npnNum': {
              'type': 'string',
              'description': 'NPN number'
            },
            'licSeries': {
              'type': 'array',
              'description': 'Check applicable series',
              'items': [
                {
                  'type': 'string',
                  'enum': ['6', '7', '65', '66']
                }
              ],
              'minItems': 0,
              'maxItems': 4
            }
          }
        }
      ]
    },
    'assignmentCommissions': {
      'type': 'boolean',
      'enum': [true, false]
    },
    'backgroundInformation': {
      '$ref': 'defsSchema.json#/definitions/backgroundInformation'
    },
    'fairCreditReporting': {
      '$ref': 'defsSchema.json#/definitions/fairCreditReporting'
    },
    'formNumber': {
      'type': 'string',
      'enum': ['SAS1023']
    },
    'formVersion': {
      'type': 'string'
    }
  }
};
module.exports = { SAS1023 };
